{include file="pageheader"}

<div class="container-fluid" style="padding:0">
	<div class="row" style="margin:0">
		<div class="col-md-12 col-sm-12 col-lg-12" style="padding:0;">
			<div class="panel panel-default">
				<div class="panel-heading">{$lang['edit'].$lang['wechat_num']}</div>
				<div class="explanation" id="explanation">
		        	<div class="ex_tit"><i class="sc_icon"></i><h4>操作提示</h4></div>
		            <ul>
		            	<li>配置前准备：</li>
		            	<li>一、需要申请一个微信服务号，并且通过微信认证。</li>
		            	<li>二、网站域名 需要通过ICP备案并正确解析到空间服务器，临时域名与IP地址无法配置。</li>
		            	<li>以上都准备好之后，登录微信公众号平台 https://mp.weixin.qq.com/，获取且依次填写好 公众号名称，公众号原始ID，Appid，Appsecret，token值。 </li>
		            	<li>特别注意自定义Token值，必须为英文或数字，长度为3-32字符，如 weixintoken，并保持后台与公众号平台填写的一致 </li>
		            	<li>复制最后一项自动生成的接口地址，对应填写到微信公众号平台 开发=> 基本配置，服务器配置下的 URL地址。 </li>
	            	</ul>
		        </div>
				<table border="0" cellpadding="0" cellspacing="0" class="table table-hover table-bordered table-striped">
					<form method="post" action="{url('wechat/modify')}" class="form-horizontal" role="form">
						<tr>
							<td width="200">{$lang['wechat_name']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[name]" class="form-control" value="{$data['name']}"/>
							</div>
							<p class="help-block">{$lang['wechat_help1']}</p>
							</td>
						</tr>
						<tr>
							<td>{$lang['wechat_id']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[orgid]" class="form-control" value="{$data['orgid']}">
							</div>
							<p class="help-block">{$lang['wechat_help2']}</p>
							</td>
						</tr>
						<!-- <tr>
							<td>{$lang['wechat_number']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[weixin]" class="form-control" value="{$data['weixin']}">
								</div>
								<p class="help-block">{$lang['wechat_help1']}</p>
								</td>
						</tr> -->
						<tr>
							<td>{$lang['appid']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[appid]" class="form-control" value="{$data['appid']}">
								</div>
								<p class="help-block">{$lang['wechat_help4']}</p>
								</td>
						</tr>
						<tr>
							<td>{$lang['appsecret']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[appsecret]" class="form-control" value="{$data['appsecret']}">
								</div>
								<p class="help-block">{$lang['wechat_help4']}</p>
								</td>
						</tr>
						<tr>
							<td>{$lang['token']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[token]" class="form-control" value="{$data['token']}">
								</div>
								<p class="help-block">{$lang['wechat_help3']}</p>
								</td>
						</tr>
						<!-- <tr>
							<td>{$lang['wechat_type']}</td>
							<td><div class="col-sm-2">
								<select name="data[type]" class="form-control">
									<option value="0" {if $data['type']==0} selected{/if}>未认证的公众号</option>
									<option value="1" {if $data['type']==1} selected{/if}>{$lang['wechat_type1']}</option>
									<option value="2" {if $data['type']==2} selected{/if}>{$lang['wechat_type2']}</option>
								</select>
								</div>
								<p class="help-block">{$lang['wechat_help5']}</p>
							</td>
						</tr>
						<tr>
							<td>微信OAuth名称</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[oauth_name]" class="form-control" value="{$data['oauth_name']}">
								</div>
							</td>
						</tr> -->
						<tr>
							<td>微信授权回调域名</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[oauth_redirecturi]" class="form-control" value="{$data['oauth_redirecturi']}">
								</div>
								<p class="help-block">示例格式：http://shop.ectouch.cn</p>
							</td>
						</tr>
						<!-- <tr>
							<td>微信OAuth推送量</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[oauth_count]" class="form-control" value="{$data['oauth_count']}" readonly>
								</div>
							</td>
						</tr>
						<tr>
							<td>{$lang['sort_order']}</td>
							<td><div class="col-sm-4">
								<input type="text" name="data[sort]" value="10" class="form-control" value="{$data['sort']}">
								</div></td>
						</tr> -->
						<tr>
							<td>电脑端账号绑定</td>
							<td><div class="col-sm-4 col-lg-2 col-md-3">
								<div  class="btn-group" data-toggle="buttons">
									<label class="btn btn-primary {if $data['oauth_status']==1}active{/if}">
										<input type="radio" name="data[oauth_status]" value="1" {if $data['oauth_status']==1}checked{/if}> {$lang['wechat_open']}
									</label>
									<label class="btn btn-primary {if $data['oauth_status']==0}active{/if}">
										<input type="radio" name="data[oauth_status]" value="0" {if $data['oauth_status']==0}checked{/if}> {$lang['wechat_close']}
									</label>
								</div>
								</div>
								<p class="help-block">开启之后，微商城会员中心会出现电脑端账号绑定按钮，绑定后不再出现。</p>
							</td>
						</tr>
						<tr>
							<td>{$lang['wechat_status']}</td>
							<td><div class="col-sm-2">
								<div  class="btn-group" data-toggle="buttons">
									<label class="btn btn-primary {if $data['status']==1}active{/if}">
										<input type="radio" name="data[status]" value="1" {if $data['status']==1}checked{/if}> {$lang['wechat_open']}
									</label>
									<label class="btn btn-primary {if $data['status']==0}active{/if}">
										<input type="radio" name="data[status]" value="0" {if $data['status']==0}checked{/if}> {$lang['wechat_close']}
									</label>
								</div>
							</div></td>
						</tr>
						{if $data['orgid']}
						<tr>
							<td>接口地址</td>
							<td><div class="col-sm-4">
								<span class="label label-success">__URL__/index.php?c=wechat&orgid={$data['orgid']}</span>
								</div>
							</td>
						</tr>
						{/if}
						<tr>
							<td></td>
							<td><div class="col-sm-4">
								<input type="hidden" name="id" value="{$data['id']}" />
								<input type="hidden" name="data[type]" value="2">
								<input type="submit" name="submit" value="{$lang['button_save']}" class="btn btn-primary" />
								</div></td>
						</tr>
					</form>
				</table>
				</div>
			</div>
		</div>
	</div>
</div>
{include file="pagefooter"}